//
//  MLZShowTableViewCell.m
//  MotherLover
//
//  Created by lanou on 16/1/7.
//  Copyright © 2016年 zj. All rights reserved.
//

#import "MLZShowTableViewCell.h"
#define CTandB 10
#define CLandR 10
@implementation MLZShowTableViewCell

- (void)awakeFromNib {
    // Initialization code
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{

    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if(self ){
    
//图片
        self.imageIco = [[UIImageView alloc]initWithFrame:CGRectMake(CLandR, CTandB, (KW-CLandR*3)/3, (KW-CLandR*3)/3-20)];
        [self.contentView addSubview:self.imageIco];
//标题
        self.lableContent = [[UILabel alloc]initWithFrame:CGRectMake(self.imageIco.right+CLandR, self.imageIco.top, self.imageIco.width*2, 50)];
        self.lableContent.numberOfLines= -1;
    
        [self.contentView addSubview:self.lableContent];
//类型
        self.type = [[UILabel alloc]initWithFrame:CGRectMake(KW-120,self.lableContent.bottom+CTandB , 100, 30)];
        _type.font= [UIFont systemFontOfSize:12];
        _type.textColor= [UIColor grayColor];
        _type.textAlignment = NSTextAlignmentRight;
        
        [self.contentView addSubview:self.type];
        
        
        
    }


return self;

}

-(void)setModel:(MLZShowModel *)model{

    _lableContent.text = model.title;
    NSArray *arr = @[model.nickname,model.cate];
    NSString *srt = [arr componentsJoinedByString:@"|"];
    _type.text= srt;
    [_imageIco sd_setImageWithURL:[NSURL URLWithString:model.pics[0]]];




}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
